using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Shell;

namespace DSLFactory.VSCTDesigner
{
    partial class VSCTDesignerCommandSet
    {
    
		#region AddKeyBindingCommand
		/// <summary>
		/// Double-derived class to allow easier code customization.
		/// </summary>
		public partial class AddKeyBindingCommand : AddKeyBindingCommandBase
		{
			public AddKeyBindingCommand(VSCTDesignerCommandSet commandSet):base(commandSet)
			{
			}
		}	
		
		public class AddKeyBindingCommandBase : Microsoft.VisualStudio.Shell.OleMenuCommand
		{
			private const int cmdidAddKeyBinding = 0x100;
			protected VSCTDesignerCommandSet CommandSet {get;set;}
			
			public AddKeyBindingCommandBase(VSCTDesignerCommandSet commandSet):
				base(OnAddKeyBindingExecute, null, OnAddKeyBindingStatus,
				new CommandID( new Guid(Constants.VSCTDesignerCommandSetId), cmdidAddKeyBinding))
			{
				CommandSet = commandSet;
			}
			
			#region Status
			private static void OnAddKeyBindingStatus(object sender, EventArgs e)
			{
				AddKeyBindingCommand command = sender as AddKeyBindingCommand;            
				command.OnQueryStatus(new EventArgs());
			}
			
			protected virtual void OnQueryStatus(EventArgs e)
			{
			}
			#endregion
			
			#region Execute
			private static void OnAddKeyBindingExecute(object sender, EventArgs e)
			{
				AddKeyBindingCommand command = sender as AddKeyBindingCommand;
				command.Execute();
			}
	        
			protected virtual void Execute()
			{
			}
			#endregion
		}
		#endregion	
    
		#region RemoveKeyBindingCommand
		/// <summary>
		/// Double-derived class to allow easier code customization.
		/// </summary>
		public partial class RemoveKeyBindingCommand : RemoveKeyBindingCommandBase
		{
			public RemoveKeyBindingCommand(VSCTDesignerCommandSet commandSet):base(commandSet)
			{
			}
		}	
		
		public class RemoveKeyBindingCommandBase : Microsoft.VisualStudio.Shell.OleMenuCommand
		{
			private const int cmdidRemoveKeyBinding = 0x101;
			protected VSCTDesignerCommandSet CommandSet {get;set;}
			
			public RemoveKeyBindingCommandBase(VSCTDesignerCommandSet commandSet):
				base(OnRemoveKeyBindingExecute, null, OnRemoveKeyBindingStatus,
				new CommandID( new Guid(Constants.VSCTDesignerCommandSetId), cmdidRemoveKeyBinding))
			{
				CommandSet = commandSet;
			}
			
			#region Status
			private static void OnRemoveKeyBindingStatus(object sender, EventArgs e)
			{
				RemoveKeyBindingCommand command = sender as RemoveKeyBindingCommand;            
				command.OnQueryStatus(new EventArgs());
			}
			
			protected virtual void OnQueryStatus(EventArgs e)
			{
			}
			#endregion
			
			#region Execute
			private static void OnRemoveKeyBindingExecute(object sender, EventArgs e)
			{
				RemoveKeyBindingCommand command = sender as RemoveKeyBindingCommand;
				command.Execute();
			}
	        
			protected virtual void Execute()
			{
			}
			#endregion
		}
		#endregion	
	
        protected override IList<System.ComponentModel.Design.MenuCommand> GetMenuCommands()
        {
            var commands = base.GetMenuCommands();
    
            commands.Add(new AddKeyBindingCommand(this));    
            commands.Add(new RemoveKeyBindingCommand(this));            
            return commands;
        }
    }
}
